﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

using NuMetaheuristics;

namespace NuMetaheuristics
{
    /// <summary>
    /// An interface which is used to perform metaheuristic-type optimizations
    /// on a group of candidate solutions. For more information on 
    /// metaheuristics, see http://en.wikipedia.org/wiki/Metaheuristic.
    /// </summary>
    /// <typeparam name="G">The genotype class which inherits from IGenotype.</typeparam>
    public interface IAlgorithm<G>
        where G : IGenotype
    {
        /// <summary>
        /// Run the algorithm against the given population, using the given 
        /// context, for a given number of iterations. Assumes the population 
        /// has already been evaluated and sorted.
        /// </summary>
        /// <param name="population">The population of candidate solutions to 
        /// operate on.</param>
        /// <param name="context">The context, containing all of the tools 
        /// necessary to work within the desired problem space</param>
        /// <param name="iterations">The number of iterations to run the 
        /// algorithm for.</param>
        void Run(Population<G> population, IContext<G> context, uint iterations);
    }
}
